'use strict';

/**
 * 教室schema
 */
const mongoose = require('mongoose'), Schema = mongoose.Schema;

const classroomSchema = new Schema({
    group_id:{ type:String }, //集团id
    group_name:{ type:String }, //集团名称
    campus_id: { type:String}, //校区id
    campus_name:{ type:String }, //校区名称
    name: { type:String, required:true }, //教室名称
    address: { type:String }, //教室地址
    num: { type:String, required:true },//教室编号
    /* 
        关联设备
        @param:related_devices
        @demo: [{device_id:1,device_name:'abc',device_uuid:'123',device_type:''}]
    */
   related_devices:{ type: Schema.Types.Mixed },//关联设备
})

module.exports = mongoose.model('ClassroomModel', classroomSchema, 'classroom')